package com.xius.controller;
import com.xius.common.ApiController;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicParameters;
import com.xius.common.R;
import com.xius.service.SecPermissionService;
import com.github.pagehelper.PageHelper;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/*
* *
* @author makejava
* @since 2020-06-12 17:14:18
*/
@RestController@RequestMapping("/api/secPermission")public class SecPermissionController extends ApiController {
    
    /*
    *     * 服务对象
    */
    @Resource    private SecPermissionService secPermissionService;
    @PostMapping("/queryAll")    @ApiOperationSupport(params = @DynamicParameters(                name = "SecPermissionControllerQueryAll",                properties = {
    @DynamicParameter(name = "secPermissionId", value = "主键"),@DynamicParameter(name = "secPermissionName", value = "权限名"),@DynamicParameter(name = "secPermissionUrl", value = "类型为页面时，代表前端路由地址，类型为按钮时，代表后端接口地址"),@DynamicParameter(name = "secPermissionType", value = "权限类型，页面-1，按钮-2"),@DynamicParameter(name = "secPermissionPermission", value = "权限表达式"),@DynamicParameter(name = "secPermissionMethod", value = "后端接口访问方式"),@DynamicParameter(name = "secPermissionSort", value = "排序"),@DynamicParameter(name = "secPermissionParentId", value = "父级id"),    }
    ))    public R queryAll(@RequestBody Map<String,Object> map) {
        return success(secPermissionService.queryAll(map));
    }
    @PostMapping("/queryAllJoin")    @ApiOperationSupport(params = @DynamicParameters(                    name = "SecPermissionControllerQueryAllJoin",                    properties = {
    @DynamicParameter(name = "secPermissionId", value = "主键"),@DynamicParameter(name = "secPermissionName", value = "权限名"),@DynamicParameter(name = "secPermissionUrl", value = "类型为页面时，代表前端路由地址，类型为按钮时，代表后端接口地址"),@DynamicParameter(name = "secPermissionType", value = "权限类型，页面-1，按钮-2"),@DynamicParameter(name = "secPermissionPermission", value = "权限表达式"),@DynamicParameter(name = "secPermissionMethod", value = "后端接口访问方式"),@DynamicParameter(name = "secPermissionSort", value = "排序"),@DynamicParameter(name = "secPermissionParentId", value = "父级id"),    }
    ))    public R queryAllJoin(@RequestBody Map<String,Object> map) {
        return success(secPermissionService.queryAllJoin(map));
    }
    @PostMapping("/queryById")    @ApiOperationSupport(params = @DynamicParameters(                    name = "SecPermissionControllerQueryById",                    properties = {
    @DynamicParameter(name = "secPermissionId", value = "主键"),@DynamicParameter(name = "secPermissionName", value = "权限名"),@DynamicParameter(name = "secPermissionUrl", value = "类型为页面时，代表前端路由地址，类型为按钮时，代表后端接口地址"),@DynamicParameter(name = "secPermissionType", value = "权限类型，页面-1，按钮-2"),@DynamicParameter(name = "secPermissionPermission", value = "权限表达式"),@DynamicParameter(name = "secPermissionMethod", value = "后端接口访问方式"),@DynamicParameter(name = "secPermissionSort", value = "排序"),@DynamicParameter(name = "secPermissionParentId", value = "父级id"),    }
    ))    public R queryById(@RequestBody Map<String,Object> map) {
        return success(secPermissionService.queryById(map));
    }
    @PostMapping("/insert")    @ApiOperationSupport(params = @DynamicParameters(                    name = "SecPermissionControllerInsert",                    properties = {
    @DynamicParameter(name = "secPermissionId", value = "主键"),@DynamicParameter(name = "secPermissionName", value = "权限名"),@DynamicParameter(name = "secPermissionUrl", value = "类型为页面时，代表前端路由地址，类型为按钮时，代表后端接口地址"),@DynamicParameter(name = "secPermissionType", value = "权限类型，页面-1，按钮-2"),@DynamicParameter(name = "secPermissionPermission", value = "权限表达式"),@DynamicParameter(name = "secPermissionMethod", value = "后端接口访问方式"),@DynamicParameter(name = "secPermissionSort", value = "排序"),@DynamicParameter(name = "secPermissionParentId", value = "父级id"),    }
    ))    public R insert(@RequestBody Map<String,Object> map) {
        return success(this.secPermissionService.insert(map));
    }
    @PostMapping("/inserts")    @ApiOperationSupport(params = @DynamicParameters(                    name = "SecPermissionControllerInserts",                    properties = {
    @DynamicParameter(name = "secPermissionId", value = "主键"),@DynamicParameter(name = "secPermissionName", value = "权限名"),@DynamicParameter(name = "secPermissionUrl", value = "类型为页面时，代表前端路由地址，类型为按钮时，代表后端接口地址"),@DynamicParameter(name = "secPermissionType", value = "权限类型，页面-1，按钮-2"),@DynamicParameter(name = "secPermissionPermission", value = "权限表达式"),@DynamicParameter(name = "secPermissionMethod", value = "后端接口访问方式"),@DynamicParameter(name = "secPermissionSort", value = "排序"),@DynamicParameter(name = "secPermissionParentId", value = "父级id"),    }
    ))    public R inserts(@RequestBody List<Map<String,Object>> list) {
        return success(this.secPermissionService.inserts(list));
    }
    @PostMapping("/update")    @ApiOperationSupport(params = @DynamicParameters(                    name = "SecPermissionControllerUpdate",                    properties = {
    @DynamicParameter(name = "secPermissionId", value = "主键"),@DynamicParameter(name = "secPermissionName", value = "权限名"),@DynamicParameter(name = "secPermissionUrl", value = "类型为页面时，代表前端路由地址，类型为按钮时，代表后端接口地址"),@DynamicParameter(name = "secPermissionType", value = "权限类型，页面-1，按钮-2"),@DynamicParameter(name = "secPermissionPermission", value = "权限表达式"),@DynamicParameter(name = "secPermissionMethod", value = "后端接口访问方式"),@DynamicParameter(name = "secPermissionSort", value = "排序"),@DynamicParameter(name = "secPermissionParentId", value = "父级id"),    }
    ))    public R update(@RequestBody Map<String,Object> map) {
        return success(this.secPermissionService.update(map));
    }
    @PostMapping("/deleteByIds")    @ApiOperationSupport(params = @DynamicParameters(                    name = "SecPermissionControllerDeleteByIds",                    properties = {
    }
    ))    public R deleteByIds(@RequestBody Map<String,Object> map) {
        return success(this.secPermissionService.deleteByIds(map));
    }
    @PostMapping("/deleteById")    @ApiOperationSupport(params = @DynamicParameters(                    name = "SecPermissionControllerDeleteById",                    properties = {
    }
    ))    public R deleteById(@RequestBody Map<String,Object> map) {
        return success(this.secPermissionService.deleteById(map));
    }
}
